/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upeu.modelo;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;

/**
 *
 * @author pc
 */
@Entity
@Table(name = "AULA")
@NamedQueries({
    @NamedQuery(name = "Aula.findAll", query = "SELECT a FROM Aula a")})
public class Aula implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "AULA_ID")
    private String aulaId;
    @Basic(optional = false)
    @Column(name = "PABELLON")
    private String pabellon;
    @Basic(optional = false)
    @Column(name = "NUM_AULA")
    private String numAula;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "aulaId")
    private Collection<Asistencia> asistenciaCollection;

    public Aula() {
    }

    public Aula(String aulaId) {
        this.aulaId = aulaId;
    }

    public Aula(String aulaId, String pabellon, String numAula) {
        this.aulaId = aulaId;
        this.pabellon = pabellon;
        this.numAula = numAula;
    }

    public String getAulaId() {
        return aulaId;
    }

    public void setAulaId(String aulaId) {
        this.aulaId = aulaId;
    }

    public String getPabellon() {
        return pabellon;
    }

    public void setPabellon(String pabellon) {
        this.pabellon = pabellon;
    }

    public String getNumAula() {
        return numAula;
    }

    public void setNumAula(String numAula) {
        this.numAula = numAula;
    }

    public Collection<Asistencia> getAsistenciaCollection() {
        return asistenciaCollection;
    }

    public void setAsistenciaCollection(Collection<Asistencia> asistenciaCollection) {
        this.asistenciaCollection = asistenciaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (aulaId != null ? aulaId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Aula)) {
            return false;
        }
        Aula other = (Aula) object;
        if ((this.aulaId == null && other.aulaId != null) || (this.aulaId != null && !this.aulaId.equals(other.aulaId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upeu.modelo.Aula[ aulaId=" + aulaId + " ]";
    }
    
}
